package come.tool.JDialog;

import com.tool.role.RoleData;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.ZhuJpanel;
import org.come.entity.RoleSummoning;
import org.come.mouslisten.ChangeMouseSymbolMouslisten;
import org.come.until.FormsManagement;

public class HuaLianJDialog implements TiShiChuLi{//葫芦娃
    @Override
    public void tipBox(boolean tishi, Object object) {
        if (tishi) {
            RoleSummoning pet = (RoleSummoning) object;
            // 判断召唤兽是否有放生
            if (pet.getPetlock() == 1) {
                ZhuFrame.getZhuJpanel().addPrompt("该召唤兽已加锁，不能化莲");
                return;
            }

            if (pet.getGoods() != null) {
                ZhuFrame.getZhuJpanel().addPrompt("该召唤兽携带着装备");
                return;
            }

            if (ZhuJpanel.getPetMount(pet.getSid()) != null) {
                ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽被管制中，不可化莲");
                return;
            }

            if (RoleData.getRoleData().getLoginResult().getSummoning_id() != null && RoleData.getRoleData().getLoginResult().getSummoning_id().compareTo(pet.getSid()) == 0) {
                ZhuFrame.getZhuJpanel().addPrompt2("这只召唤兽已在参战中！！！");
                return;
            }
            ChangeMouseSymbolMouslisten.releasePet(pet,true);
            FormsManagement.HideForm(701);
        }

    }
}
